import request from '@/utils/request'


const api_name = '/admin/acl/permission'

export const doAssign = (roleId, permissionId)=>request({
    url: `${api_name}/doAssign`,
    method: "post",
    params: { roleId, permissionId }
});
export const toAssign = (roleId)=>request({
    url: `${api_name}/toAssign/${roleId}`,
            method: 'get'
});
export const updatePermission = (permission)=>request({
    url: `${api_name}/update`,
    method: "put",
    data: permission
});
export const addPermission = (permission)=>request({
    url: `${api_name}/save`,
    method: "post",
    data: permission
});
export const removePermission = (id)=>request({
    url: `${api_name}/remove/${id}`,
            method: "delete"
});
export const getPermissionList = ()=>request({
    url: `${api_name}`,
    method: 'get'
});